package com.example.client;


import com.example.common.dto.LoginDto;
import com.example.common.dto.PageDto;
import com.example.common.vo.PageVo;
import com.example.common.vo.Result;
import com.example.entity.dto.TeacherDto;
import com.example.entity.vo.TeacherVo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "teacher", url = "http://localhost:8081")
public interface TeacherClient {

    @GetMapping("/teacher/{teacherId}")
    Result<TeacherVo> getTeacherById(@PathVariable Integer teacherId);

    @PostMapping("/teacher")
    Result<Boolean> addTeacher(@RequestBody TeacherDto teacherDto);

    @DeleteMapping("/teacher/{teacherId}")
    Result<Boolean> deleteTeacherById(@PathVariable Integer teacherId);

    @PutMapping("/teacher")
    Result<Boolean> updateTeacher(@RequestBody TeacherDto teacherDto);

    @PostMapping("/teacher/page")
    Result<PageVo<TeacherVo>> getTeacherPage(@RequestBody PageDto<TeacherDto> pageDto);

    @PostMapping("/teacher/login")
    Result<Integer> login(LoginDto loginDto);

    @GetMapping("/teacher/getIdsByName/{teacherName}")
    Result<List<Integer>> getTeacherIdsByName(@PathVariable String teacherName);

}
